package com.haiyou.dc.suanfa;

public class TestRabbit {

    public static void main(String[] args) {
        Integer integer = get(12);
        System.out.println(integer);
    }

    public static Integer get(int n) {
        if(n<=0){
            return 0;
        }else if (n <= 2) {
            return 1;
        }
        return get(n-1) + get(n - 2);
    }

    public static Integer get2(int n) {
        if (n < 2) {
            return 1;
        }
        int a = 1;
        int b = 0;
        int fibN = 0;
        for (int i = 2; i <= n; i++) {
            fibN = a + b;
            b = a;
            a = fibN;
        }
        return fibN;

    }
}
